const remote = require("@electron/remote")

window.addEventListener("DOMContentLoaded", () => {
    const oBtn = document.getElementById("btn");
    oBtn.addEventListener("click", () => {
        let subWin = new remote.BrowserWindow({
            parent: remote.getCurrentWindow(),
            width: 500,
            height: 300
        })

        console.log("loadFile");

        subWin.loadFile("sub.html");

        subWin.on("close", () => {
            subWin = null;
        })
    })
})